const path = require('path')

module.exports = {
	mode: 'production',
	module: {
		rules: [
			{
				test: /\.(js|jsx)$/,
				loader: 'babel-loader',
				include: [
					/src/,
					'/node_modules/antd/ '
				]
			},
			{
				test: /\.(jpg|jpeg|png|gif)$/,
				use: [
					{
						loader: 'url-loader',
						options: {
							limit: 8192,    // 小于8k的图片自动转成base64格式，并且不会存在实体图片
							outputPath: 'images/',  // 图片打包后存放的目录
							publicPath: '/images/'
						}
					}
				]
			},
			{
				test: /\.(eot|ttf|woff|svg)$/,
				use: 'file-loader'
			}
		]
	}
}